package com.ly.web.controller.erp;


import com.ly.common.annotation.Log;
import com.ly.common.core.domain.AjaxResult;
import com.ly.common.enums.BusinessType;
import com.ly.heart.domain.KingSubsidyEntity;
import com.ly.heart.domain.dto.KingSubsidyDto;
import com.ly.heart.service.IKingSubsidyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 出行住宿补助标准 前端控制器
 * </p>
 *
 * @author WuZH
 * @since 2024-08-18
 */
@Api(value = "KingSubsidyEntity", tags = "出行住宿补助标准")
@RestController
@RequestMapping("/heart/kingSubsidy")
public class KingSubsidyController {
    @Resource
    private IKingSubsidyService kingSubsidyService;

    @PreAuthorize("@ss.hasPermi('heart:kingSubsidy:remove')")
    @Log(title = "出行住宿补助标准", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    @ApiOperation("删除出行住宿补助标准")
    public AjaxResult remove(@PathVariable String[] ids) {
        return kingSubsidyService.deleteSingle(ids);
    }

    @Log(title = "禁用", businessType = BusinessType.UPDATE)
    @GetMapping("/disabled")
    @ApiOperation("禁用/解禁出行住宿补助标准")
    public AjaxResult disabled(String id) {
        return kingSubsidyService.disabled(id);
    }

    @Log(title = "暂存出行住宿补助标准", businessType = BusinessType.INSERT)
    @PostMapping("/draft")
    @ApiOperation("暂存出行住宿补助标准")
    public AjaxResult draft(KingSubsidyDto kingSubsidyDto) {
        return kingSubsidyService.draft(kingSubsidyDto);
    }

    @Log(title = "提交出行住宿补助标准", businessType = BusinessType.INSERT)
    @PostMapping("/submit")
    @ApiOperation("提交出行住宿补助标准")
    public AjaxResult submit(KingSubsidyEntity kingSubsidyEntity) {
        return kingSubsidyService.submit(kingSubsidyEntity);
    }



}
